package particlesystem.effects {
	import particlesystem.core.ParticleData;
	import particlesystem.utils.Range;

	/**
	 * @author robertthurston
	 */
	public class DecayEffect implements IEffect {

		private var decay : Range;

		public function DecayEffect(min : Number, max : Number) {
			decay = new Range(min, max);
		}

		public function reset(particleData : ParticleData) : void {
			particleData.decay = decay.range;
		}

		public function update(particleData : ParticleData) : void {
			particleData.xSpeed *= particleData.decay;
			particleData.ySpeed *= particleData.decay;
		}
	}
}
